package com.springsource.boot.run;

import org.springframework.boot.SpringBootVersion;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.DefaultResourceLoader;

import java.util.Map;

public class Step7 {

    public static void main(String[] args) {
//        StandardEnvironment env = new StandardEnvironment();
//        SpringApplicationBannerPrinter printer = new SpringApplicationBannerPrinter(new DefaultResourceLoader(), new SpringbootBanner());
//        MutablePropertySources propertySources = env.getPropertySources();
//        // 增加文本banner
//        propertySources.addLast(new MapPropertySource("custom", Map.of("spring.banner.location","banner1.txt")));
//        // 图片banner
//        propertySources.addLast(new MapPropertySource("custom", Map.of("spring.banner.image.location","banner2.png")));
//        // 版本号获取
//        System.out.println(SpringBootVersion.getVersion());
//
//        // 输出banner
//        printer.print(env, Step7.class, System.out);
    }


}
